package xyz.cerberu.cet.resource.domian;

import com.bete.MD5Utils;
import xyz.cerberu.cet.subtitle.domain.Subtitle;
import org.apache.solr.client.solrj.beans.Field;

import java.io.Serializable;

/**
 * @Name β世界
 * Created on 15:35
 * @Description 资源的实体类
 */
public class Resource implements Serializable {
    /** 资源的id **/
    @Field("res_id")
    private String res_id;
    /** 动漫的id **/
    @Field("ani_id")
    private String ani_id;
    /** 字幕组的id **/
    @Field("subtitle")
    private Subtitle subtitle;
    /** 资源的标题 **/
    @Field("resource_title")
    private String resource_title;
    /** 资源的磁力 **/
    @Field("magentURL")
    private String magentURL;
    /** 更新的时间 **/
    @Field("update_time")
    private String update_time;

    public void setRes_id() {
        this.res_id = MD5Utils.stringToMD5(magentURL);
    }

    public void setAni_id(String ani_id) {
        this.ani_id = ani_id;
    }

    public void setSubtitle(Subtitle subtitle) {
        this.subtitle = subtitle;
    }

    public void setResource_title(String resource_title) {
        this.resource_title = resource_title;
    }

    public void setMagentURI(String magnetURI) {
        this.magentURL = magnetURI;
    }

    public void setUpdate_time(String update_date) {
        this.update_time = update_date;
    }

    public String getRes_id() {
        return res_id;
    }

    public String getAni_id() {
        return ani_id;
    }

    public Subtitle getSubtitle() {
        return subtitle;
    }

    public String getResource_title() {
        return resource_title;
    }

    public String getMagentURL() {
        return magentURL;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public Resource() {
    }

    public Resource(String res_id, String ani_id, Subtitle subtitle, String resource_title, String magentURL, String update_time) {
        this.res_id = res_id;
        this.ani_id = ani_id;
        this.subtitle = subtitle;
        this.resource_title = resource_title;
        this.magentURL = magentURL;
        this.update_time = update_time;
    }

    @Override
    public String toString() {
        return "Resource{" +
                "res_id='" + res_id + '\'' +
                ", ani_id='" + ani_id + '\'' +
                ", subtitle=" + subtitle +
                ", resource_title='" + resource_title + '\'' +
                ", magnetURL='" + magentURL + '\'' +
                ", update_time='" + update_time + '\'' +
                '}';
    }
}
